package org.leopard.demo.service;

import java.rmi.RemoteException;
import org.leopard.rpc.Producer;
import org.leopard.rpc.ServiceCenter;
import org.leopard.rpc.rmi.RMIProducer;

/**
 * @author IBM CHEN ZHI KAN
 * @create 2018/8/13
 */
public class Service {

  public static void main(String[] args) throws RemoteException {
    User user=new User();
    user.setAge("12");
    user.setName("cz");
    user.setId("1");
    ServiceCenter serviceCenter=ServiceCenter.getInstance("127.0.0.1");
    UserService userService=new UserServiceImpl(new User());
    Producer producer=new RMIProducer("127.0.0.1","8900",userService.getClass().getName());
    producer.publish(serviceCenter);


  }
}
